package org.smart4j.framework.helper;

import java.util.Properties;

import org.smart4j.framework.ConfigConstant;
import org.smart4j.framework.util.PropsUtil;

public final class ConfigHelper {
	
	private static final Properties props = PropsUtil.loadProps(ConfigConstant.CONFIG_FILE);
	
	/**
	 * 获取JdbcDriver
	 * @return
	 */
	public static String getJdbcDriver(){
		return PropsUtil.getString(props, ConfigConstant.JDBC_DRIVER);
	}
	
	/**
	 * 获取JdbcUrl
	 * @return
	 */
	public static String getJdbcUrl(){
		return PropsUtil.getString(props, ConfigConstant.JDBC_URL);
	}
	
	/**
	 * 获取JdbcUrl
	 * @return
	 */
	public static String getJdbcUserName(){
		return PropsUtil.getString(props, ConfigConstant.JDBC_USERNAME);
	}
	
	/**
	 * 获取JdbcPassword
	 * @return
	 */
	public static String getJdbcPassword(){
		return PropsUtil.getString(props, ConfigConstant.JDBC_PASSWORD);
	}

	/**
	 * 获取AppBasePackage 基础包名
	 * @return
	 */
	public static String getAppBasePackage(){
		return PropsUtil.getString(props, ConfigConstant.APP_BASE_PACKAGE);
	}
	
	/**
	 * 获取AppAppJspPath JSP路径
	 * @return
	 */
	public static String getAppJspPath(){
		return PropsUtil.getString(props, ConfigConstant.APP_JSP_PATH,"/WEB-INF/view/");
	}
	
	/**
	 * 获取AppAssetPath 静态资源存放路径
	 * @return
	 */
	public static String getAppAssetPath(){
		return PropsUtil.getString(props, ConfigConstant.APP_ASSET_PATH,"/asset/");
	}
	
}
